package com.jp.knowledge.broad;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * Created by jiayen on 16/11/14.
 *
 * 使用本地广播来更新状态
 */

public class LocalBroadCast extends BroadcastReceiver {

    /***点赞广播*/
    public static final String PRISE_BROAD="jp.topic.prise";

    /***头条详情收藏广播*/
    public static final String DETAIL_SC_BROAD="jp.info.detail.sc";

    /***添加话题广播*/
    public static final String ADD_TOPIC_BROAD="jp.info.add.topic";


    /***获取关注数据广播（现在的雷达）*/
    public static final String GET_ATTION_DATA_BROAD="jp.info.get.attention.data";

    /***关注事件（现在的雷达）*/
    public static final String ATTENTION_EVENT_BROAD ="jp.info.get.attention_event";

    /**
     * 获取登录后(获取信息)的个人广播
     */
    public static final String GET_LOGIN_INFO="jp.info.get.login.info";

    /**
     * 登录成功广播
     */
    public static final String LOGIN_SUCCESS_BROD="jp.info.login.success";

    /**
     * 首次登录
     * */
    public static final String FIRST_LOGIN = "jp.info.firstLogin";

    /**
     * 用户信息发生改变
     * */
    public static final String USER_DATA_CHANGE = "jp.info.userDatChange";


    /**
     * web加载完成
     */
    public static final String WEB_LOADING_BROAD="jp.info.web.loading.success";

    /**
     * 改变字体大小广播
     */
    public static final String COMM_CHANGE_SIZE="jp.comm.font.size.change";

    /**
     * 删除体验组
     */
    public static final String DEL_TIYAN_GROUP="jp.comm.tiyan.del.group";

    /**
     * 校正分类成功
     */
    public static final String HEAD_NAV_CORRECTING="jp.comm.headnav.correcting";

    /**
     * web端跳到文库详情
     */
    public static final String WEB_DOC_DETAIL="jp.comm.web.doc.detail";

    /**
     * 搜索
     */
    public static final String TO_SEARCH = "jp.com.web.to_search";

    /**
     * 隐藏/显示状态来
     */
    public static final String TOGGLE_TIME = "jp.com.web.toggle_time";

    /**
     * 使用应用浏览器打开网页
     */
    public static final String OPEN_URL_WITH_BROWSER = "jp.com.web.open_url";

    /**
     * 重新获取体验列表
     */
    public static final String UPDATE_LIGHT_EXT = "jp.com.web.updateLightExt";

    /**
     * 添加体验产品
     */
    public static final String ADD_EXP_APP = "jp.com.addExpApp";

    /**
     * 添加关注
     */
    public static final String ADD_ATTENTION = "jp.com.addAttention";

    /**
     * 退出登陆
     * */
    public static final String LOGOUT_SUCCESS_BROD="jp.info.logout.success";

    /**
     * 发现页面获取 app 数据成功
     * */
    public static final String FOUND_GET_APPDATA_SUCCESS = "jp.found.appdata.success";

    /**
     * 发现页面获取 循环图片数据成功
     * */
    public static final String FOUND_GET_BANNER_SUCCESS = "jp.found.banner.success";

    /**
     * 连接到网络
     * */
    public static final String CONNECT_NET_BROAD = "jp.connectToNext";

    /**
     * 断开网络连接
     * */
    public static final String UNCONNECT_NET_BROAD = "jp.unconnectToNext";

    /**
     * 最近体验
     * */
    public static final String GET_LAST_EXPERIENCE = "jp.last.experience";
    /**
     * 我的体验
     * */
    public static final String GET_MY_EXPERIENCE = "jp.my.experience";

    /**
     * 公司加入
     * */
    public static final String COMPANY_JOIN = "jp.my.companyJoin";

    /**
     * 公司退出
     * */
    public static final String COMPANY_EXIT = "jp.my.companyExit";

    /**
     * 公司排序
     * */
    public static final String COMPANY_SORT = "jp.my.companySort";

    /**
     * 导航排序
     * */
    public static final String HEAD_LINE_SORT = "jp.headline.sort";

    /* 获取发现图标数据 */
    public static final String GET_APPDATA_CODE = "jp.my.get_appdata_code";

    /* 获取发现广告图数据 */
    public static final String GET_BANNER_CODE = "jp.my.get_banner_code";

    /* 获取我的体验数据 */
    public static final String GET_MY_EXPERIENCE_CODE = "jp.my.get_my_experience_code";

    /* 获取最近体验数据 */
    public static final String GET_MY_LAST_EXPERIENCE_CODE = "jp.my.get_my_last_experience_code";

    /* 重新绑定手机 */
    public static final String PHONE_REBIND_CODE = "jp.my.phone_rebind";

    /* 团队圈互动消息数据 */
    public static final String GET_INTERACT_DATA_CODE = "jp.interact_data";

    /* 团队圈互动消息数据 */
    public static final String TEAM_CIRCLE_DATA_CHANGE = "jp.team_circle_data_change";

    /* 团队圈数据删除 */
    public static final String TEAM_CIRCLE_DATA_DELETE = "jp.team_circle_data_delete";

    /* 付费阅读 */
    public static final String PAY_TO_READ = "jp.pay_to_read";

    private BroadCastCallBack callBack;

    public LocalBroadCast(BroadCastCallBack callBack){
        this.callBack=callBack;
    }


    @Override
    public void onReceive(Context context, Intent intent) {
//           String recommendAction  =  intent.getAction();
            if(callBack!=null)
                callBack.done(context,intent);
    }


    public interface  BroadCastCallBack{
         void done(Context context, Intent intent);
    }
}
